package com.lagou.session;

import com.lagou.pojo.Configuration;

/**
 * 默认sqlSession工厂类
 *
 * @author Tengfei.Wang
 * @date 26/8/2020
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    public SqlSession openSession() {
        SimpleExecutor simpleExecutor = new SimpleExecutor();
        return new DefaultSqlSession(configuration, simpleExecutor);
    }
}
